package org.publiccms.entities.home;
// Generated 2016-11-13 13:44:22 by Hibernate Tools 4.3.1

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.publiccms.common.generator.annotation.GeneratorColumn;

/**
 * HomeDialog generated by hbm2java
 */
@Entity
@Table(name = "home_dialog")
public class HomeDialog implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @GeneratorColumn(title = "ID")
    private HomeDialogId id;
    @GeneratorColumn(title = "消息数")
    private int messages;
    @GeneratorColumn(title = "最新消息日期", order = true)
    private Date lastMessageDate;
    @GeneratorColumn(title = "最后阅读日期")
    private Date readedMessageDate;
    @GeneratorColumn(title = "已禁用", condition = true)
    private boolean disabled;
    @GeneratorColumn(title = "创建日期")
    private Date createDate;

    public HomeDialog() {
    }

    public HomeDialog(HomeDialogId id, int messages, Date lastMessageDate, Date readedMessageDate, boolean disabled,
            Date createDate) {
        this.id = id;
        this.messages = messages;
        this.lastMessageDate = lastMessageDate;
        this.readedMessageDate = readedMessageDate;
        this.disabled = disabled;
        this.createDate = createDate;
    }

    @EmbeddedId

    @AttributeOverrides({ @AttributeOverride(name = "userId", column = @Column(name = "user_id", nullable = false)),
            @AttributeOverride(name = "itemType", column = @Column(name = "item_type", nullable = false, length = 20)),
            @AttributeOverride(name = "itemId", column = @Column(name = "item_id", nullable = false)) })
    public HomeDialogId getId() {
        return this.id;
    }

    public void setId(HomeDialogId id) {
        this.id = id;
    }

    @Column(name = "messages", nullable = false)
    public int getMessages() {
        return this.messages;
    }

    public void setMessages(int messages) {
        this.messages = messages;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_message_date", nullable = false, length = 19)
    public Date getLastMessageDate() {
        return this.lastMessageDate;
    }

    public void setLastMessageDate(Date lastMessageDate) {
        this.lastMessageDate = lastMessageDate;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "readed_message_date", nullable = false, length = 19)
    public Date getReadedMessageDate() {
        return this.readedMessageDate;
    }

    public void setReadedMessageDate(Date readedMessageDate) {
        this.readedMessageDate = readedMessageDate;
    }

    @Column(name = "disabled", nullable = false)
    public boolean isDisabled() {
        return this.disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_date", nullable = false, length = 19)
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

}
